home *** CD-ROM | disk | FTP | other *** search
/ CD Ware Multimedia 1995 May / cd Ware (Juegos) Epimundo.iso / DOS / C / DIALOG.ZIP / HYPE2--@.COM / HYPEIT.C < prev    next >
Encoding:
C/C++ Source or Header  |  1989-09-08  |  2.3 KB  |  84 lines

  1. /*
  2.  
  3.  Compile this program under large model, with the
  4.  default compiler options and link it with these libs.
  5.  (Use the libs that correspond to your compiler.) :
  6.  
  7.  WindowPro large model library,
  8.  DialogPro large model library, and
  9.  HypeIt!   large model library
  10.  
  11. */
  12.  
  13. #include "pro.h"
  14. #include "xglobals.h"
  15. #include "dbpro.h"
  16. #include "hypeit.h"
  17. #include "colors.h"
  18. #include <stdlib.h>
  19. #include <conio.h>
  20.  
  21. /*
  22. stack requirements are generally dependent on the maximum number
  23. of connectors allowed in each node. (defined by MAXDEFS.)
  24.  
  25. In this case we used a MAXDEFS of 35.  When we invoked hypeit
  26. from within hypeit we ran out of stack space -- so we had to
  27. increase it somewhat.  If you are using MS C you will need to
  28. increase stack size at link time.
  29. */
  30. #ifdef __TURBOC__
  31. unsigned _stklen = 5000;
  32. #endif
  33.  
  34. main(argv, argc)
  35. int argv;
  36. char *argc[];
  37. {
  38.     char *t, *i, t1[20], i1[20];
  39.     int quit = 0;
  40.  
  41.     if (argv == 1) {
  42.        t = "hypeit.txt";
  43.        i = "hypeit.idx";
  44.     }
  45.     else {
  46.          sprintf(t1,"%s.txt",argc[1]);
  47.          sprintf(i1,"%s.idx",argc[1]);
  48.          t = t1;
  49.          i = i1;
  50.     }
  51.  
  52.     /* change the default colors to something more pleasing */
  53.     default_db_colors.response_bg = black;
  54.     default_db_colors.response_fg = white;
  55.     default_db_colors.question_bg = black;
  56.     default_db_colors.question_fg = white;
  57.     default_db_colors.key_bg = black;
  58.     default_db_colors.key_fg = red;
  59.     default_db_colors.select_bg = lightgray;
  60.     default_db_colors.select_fg = black;
  61.  
  62.     /* initializes the windowing, dialog box and help systems */
  63.     init_help(t, i);
  64.  
  65.     /* If you are using DialogPro you would go on and establish */
  66.     /* your dialog boxes and windows and register each dialog box */
  67.     /* with the help system, whenever the user pressed F1 it would */
  68.     /* enter HypeIt! by calling dispnode with the appropriate text */
  69.     /* id given the context that the F1 key was in when it was */
  70.     /* pressed.   In this case, since we don't really have a real */
  71.     /* application we bypass the built in help system and go */
  72.     /* directly to our main text node. */
  73.     while (!quit) {
  74.         dispnode(TOPICSNODE);
  75.         printf("Exit? (Y)es or (N)o ");
  76.         switch(getch()) {
  77.             case 'Y':
  78.             case 'y':
  79.                 exit(0);
  80.                 break;
  81.         }
  82.     }
  83. }
  84.